---
category: Object
created: '2020-06-02'
title: Extract values of a property from an array of objects
---

**JavaScript version**

```js pluck.js
const pluck = (objs, property) => objs.map((obj) => obj[property]);
```

**Examples**

```js examples.js
pluck(
    [
        { name: 'John', age: 20 },
        { name: 'Smith', age: 25 },
        { name: 'Peter', age: 30 },
    ],
    'name'
); // ['John', 'Smith', 'Peter']
```
